﻿using MediatR;
using SystemHYS.API.Application.command.GualityGroupCommand;
using SystemHYS.Domian;
using SystemHYS.Infrstructre.Interface;

namespace SystemHYS.API.Application.commandler.GualityGroupCommandler
{
    public class GualityGroupSelectCommandler:IRequestHandler<GualityGroupSelectCommand,List<GualityGroup>>
    {
        IGualityGroupRepository GroupRepository;
        public GualityGroupSelectCommandler(IGualityGroupRepository GroupRepository)
        {
            this.GroupRepository = GroupRepository;
        }

        public async Task<List<GualityGroup>> Handle(GualityGroupSelectCommand request, CancellationToken cancellationToken)
        {
            return await GroupRepository.GetAllAsnc();
        }
    }
}
